package pl.nazaweb.imedproplus.rest.pojo;

import java.math.BigInteger;
import java.util.Date;
import pl.nazaweb.imedproplus.model.entity.Patient;

public class PatientPojo {

    public Date dateOfBirth;
    public static final long serialVersionUID = 1L;
    public Long id;
    public String firstName;
    public String lastName;
    public String pesel;
    public String placeOfBirth;
    public String street;
    public String city;
    public String post;
    public String postCode;
    public String phone;
    public BigInteger paymentInstitution;
    public String email;
    public String insuranceNumber;
    public String insuranceType;

    public PatientPojo(){
    }
    
    public PatientPojo(Patient patient) {
        this.dateOfBirth = patient.getDateOfBirth();
        this.id = patient.getId();
        this.firstName = patient.getFirstName();
        this.lastName = patient.getLastName();
        this.pesel = patient.getPesel();
        this.placeOfBirth = patient.getPlaceOfBirth();
        this.street = patient.getStreet();
        this.city = patient.getCity();
        this.post = patient.getPost();
        this.postCode = patient.getPostCode();
        this.phone = patient.getPhone();
        this.paymentInstitution = patient.getPaymentInstitution();
        this.email = patient.getEmail();
        this.insuranceNumber = patient.getInsuranceNumber();
        this.insuranceType = patient.getInsuranceType();
    }
    
    public Patient getEntity(){
        Patient patient = new Patient();
        patient.setDateOfBirth(dateOfBirth);
        patient.setId(id);
        patient.setFirstName(firstName);
        patient.setLastName(lastName);
        patient.setPesel(pesel);
        patient.setPlaceOfBirth(placeOfBirth);
        patient.setStreet(street);
        patient.setCity(city);
        patient.setPost(post);
        patient.setPhone(phone);
        patient.setPaymentInstitution(paymentInstitution);
        patient.setEmail(email);
        patient.setInsuranceNumber(insuranceNumber);
        patient.setInsuranceType(insuranceType);
        return patient;
    }
}
